#include <iostream>

#include "Grid.h"
#include "Variables.h"

using namespace std;

int Variables::granularity = 0;
float Variables::threshold = 0;

int main (int argc, char * const argv[]) {
	
	if (argc != 4) {
	 	cout << "Wrong input data. The syntax of this command is:\n";
	 	cout << "apdf <input_file> <granularity> <threshold>\n";
	 	exit(1);
    }
		 
    char *file_name = argv[1];
    int granularity = atoi((char *) argv[2]);
	if (granularity < 2) {
	 	cout << "Minimum granularity has to be at least 2" << endl;
	 	exit(1);
    }
	float threshold = atof((char *) argv[3]);
	if (threshold <= 0.0) {
	 	cout << "Minimum threshold has to be greater than 0.0" << endl;
	 	exit(1);
    }

	Grid * grid = new Grid(granularity, threshold);
	
	cout << grid;
	
	return 0;
}
